import type { RouteRecordRaw } from 'vue-router';
import RouterView from '@/layout/routerView/index.vue';
import menu from '@/assets/menuIcon/menu11.png';

const moduleName = 'basis';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/basis',
    name: moduleName,
    component: RouterView,
    redirect: '/basis/organization',
    meta: {
      title: '基础配置',
      icon: menu,
    },
    children: [
      {
        path: 'organization',
        name: `${moduleName}-organization`,
        component: () => import('@/views/basis/organization/index.vue'),
        meta: {
          title: '组织架构',
        },
      },
      {
        path: 'role',
        name: `${moduleName}-role`,
        component: () => import('@/views/basis/role/index.vue'),
        meta: {
          title: '角色配置',
        },
      },
      {
        path: 'information',
        name: `${moduleName}-information`,
        component: () => import('@/views/basis/information/index.vue'),
        meta: {
          title: '公司信息',
        },
      },
      {
        path: 'approval',
        name: `${moduleName}-approval`,
        component: () => import('@/views/basis/approval/index.vue'),
        meta: {
          title: '审批设置',
        },
      },
      {
        path: 'dictionary',
        name: `${moduleName}-dictionary`,
        component: () => import('@/views/basis/dictionary/index.vue'),
        meta: {
          title: '数据字典配置',
        },
      },
      {
        path: 'dayLog',
        name: `${moduleName}-dayLog`,
        component: () => import('@/views/basis/dayLog/index.vue'),
        meta: {
          title: '操作日志',
        },
      },
    ],
  },
];

export default routes;
